#include "./pnode.h"

mds_pnode *mds_pnode_create( size_t num_particles )
{
	mds_pnode *nodes = NULL;
	assert( num_particles > 0 );
	nodes = MDS_CALLOC_AS(mds_pnode,num_particles);
	if( nodes )
	{
		register size_t i;
		for( i=0; i < num_particles; ++i )
		{
			nodes[i].id = i;
		}
	}
	return nodes;
}

void mds_pnode_delete( mds_pnode *nodes, size_t num_particles )
{
	if( nodes )
	{
		assert(num_particles>0);
		MDS_FREE_AS(mds_pnode,nodes,num_particles);
	}
}
